// src/Animal.hpp
#ifndef ANIMAL_HPP
#define ANIMAL_HPP

#include <string>

class Animal {
public:
    explicit Animal(std::string name)
      : name_(std::move(name)) {}
    virtual ~Animal() = default;

    // 多态接口：让动物“说话”
    virtual void speak() const = 0;

protected:
    std::string name_;
};

#endif // ANIMAL_HPP